package com.cloud.service;

import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult;
import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler;
import org.apache.commons.lang3.ObjectUtils;

/**
 * poi导出检验类
 *
 * @author yzj
 */
public class PoiExcelHandler<T> implements IExcelVerifyHandler<T> {

    /**
     * 校验行是否为空
     */
    @Override
    public ExcelVerifyHandlerResult verifyHandler(T obj) {
        ExcelVerifyHandlerResult result = new ExcelVerifyHandlerResult(true);
        if (ObjectUtils.isNotEmpty(obj)) {
            result.setSuccess(true);
        } else {
            result.setSuccess(false);
        }
        return result;
    }

}
